package com.app.micaihu.bean.news;

import android.view.View;

import com.app.micaihu.R;
import com.app.micaihu.videoplayer.JCVideoPlayer;
import com.app.micaihu.videoplayer.JCVideoPlayerStandard;


/**
 * 视频文章大图(适配推荐列表的视频)
 * Created by linkai on 2016/7/18.
 */
public class ViewVideoBigImgOne extends ViewNewsParent {

    private JCVideoPlayerStandard jcVideoPlayerStandard;

    public ViewVideoBigImgOne(View convertView) {
        initView(convertView);
    }

    public void initView(View convertView) {
        super.initView(convertView);
        jcVideoPlayerStandard = (JCVideoPlayerStandard) convertView.findViewById(R.id.item_videoplayer);
        jcVideoPlayerStandard.setShowTitle(false);
        convertView.setTag(this);
    }

    /**
     * 加载数据
     * @param newsEntity
     */
    public void loadData(NewsEntity newsEntity){
        super.loadData(newsEntity);
        jcVideoPlayerStandard.setUp(newsEntity.getVideoCurl(), JCVideoPlayer.SCREEN_LAYOUT_LIST,
                newsEntity.getArticleTitle(),newsEntity.getArticleThumb()[0]);
        jcVideoPlayerStandard.setShareBean(newsEntity,newsEntity.getUrlStatus());
    }

    /**
     * 加载数据
     * @param newsEntity
     * @param matchStr
     */
    public void loadData(NewsEntity newsEntity, String matchStr){
        loadData(newsEntity);
        super.matchTitle(newsEntity.getArticleTitle(), matchStr);
    }

}
